package api

import (
	"219yk/api/handlers"
	"219yk/api/middleware"
	"github.com/gin-gonic/gin"
	jwt "github.com/golangblogs/gojwt"
)

func LoadRouter(r *gin.Engine) {
	r.Use(middleware.DoeM())
	user := r.Group("/user")
	{
		user.POST("/smsSend", handlers.SmsSend)
		user.POST("/login", handlers.Login)
		user.Use(jwt.JWTAuth("2209a"))
		user.POST("/addvideo", handlers.AddVideo)
		user.GET("/chat", handlers.Chat)
		user.POST("/concern", handlers.ConCern)
		user.POST("/good", handlers.Good)
		user.POST("/comment", handlers.Comment)
		user.POST("/list", handlers.List)
		user.POST("/upload", handlers.Upload)
		user.POST("/history", handlers.History)
		user.POST("/addroom", handlers.AddRoom)
		user.POST("/adduserroom", handlers.AddUserRoom)
		user.POST("/Updateulevel", handlers.UpdateUlevel)
		user.POST("/DelRoom", handlers.DelRoom)
	}
}
